package ru.vpitervip.app.client;





import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

import ru.vpitervip.app.client.place.ContactsPlace;
import ru.vpitervip.app.client.place.FlatsPlace;
import ru.vpitervip.app.client.place.InformationPlace;
import ru.vpitervip.app.client.place.MainPlace;
import ru.vpitervip.app.client.place.MenuItemPlace;
import ru.vpitervip.app.client.place.PaymentPlace;
import ru.vpitervip.app.client.place.ServicesPlace;
import ru.vpitervip.app.client.style.AppResources;
import ru.vpitervip.app.client.style.HorizontalScrollBarResources;
import ru.vpitervip.app.client.style.ScrollPanelResouces;
import ru.vpitervip.app.client.style.VerticalScrollBarResources;

import com.google.gwt.core.client.GWT;
import com.google.gwt.place.shared.Place;

public class App {

	
	static boolean isMobile = false;
	
	private static AppResources res;
	
	private static ScrollPanelResouces spRes;
	
	private static HorizontalScrollBarResources hsRes;
	
	private static VerticalScrollBarResources vsRes;
	
	
	public static AppResources getAppResources() {
		if (res == null) {
			res = GWT.create(AppResources.class);
			res.style().ensureInjected();
		}
		return res;
	}
	
	public static ScrollPanelResouces getScrollBarResources() {
		if (spRes == null) {
			spRes = GWT.create(ScrollPanelResouces.class);
			spRes.customScrollPanelStyle().ensureInjected();
		}
		return spRes;
	}
	
	public static VerticalScrollBarResources getVerticalScrollBarResources() {
		if (vsRes == null) {
			vsRes = GWT.create(VerticalScrollBarResources.class);
			vsRes.nativeVerticalScrollbarStyle().ensureInjected();
		}
		return vsRes;
	}
	
	public static HorizontalScrollBarResources getHorizontalScrollBarResources() {
		if (hsRes == null) {
			hsRes = GWT.create(HorizontalScrollBarResources.class);
			hsRes.nativeHorizontalScrollbarStyle().ensureInjected();
		}
		return hsRes;
	}
	

	public static boolean isMobile() {
	
		return isMobile;
	}

	public void run() {
	}
	
	
	protected List<MenuItemPlace> getMainMenuPlaces(){
		List<MenuItemPlace> places=new ArrayList<MenuItemPlace>();
		
		places.add(new MainPlace("Главная"));
		places.add(new FlatsPlace("Квартиры"));
		places.add(new InformationPlace("Информация"));
		places.add(new PaymentPlace("Бронирование/Оплата"));
		places.add(new ServicesPlace("Услуги"));
		places.add(new ContactsPlace("Контакты"));
		
		
		return places;
		
	}
	
}
